//
//  CCommentary.h
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-13.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CProduct.h"

#define Com_Properties_Num  7

@class CProduct;

@interface CCommentary : NSObject <OperationDelegate>

@property (nonatomic, retain) NSString * C_PubNick;
@property (nonatomic, retain) NSString * C_Content;
@property (nonatomic, retain) NSString * C_PubIconUrl;

@property (nonatomic, retain) NSNumber * C_PubID;
@property (nonatomic, retain) NSNumber * C_AID;
@property (nonatomic, retain) NSNumber * P_AID;
@property (nonatomic, retain) NSNumber * C_Date;

@property (nonatomic, assign) BOOL          m_bIsLoadIcon;
@property (nonatomic, assign) UIImageView   *m_ImageView;
@property (nonatomic, retain) CTask         *m_IconTask;

+(int)CreateCommentaryTable;
+(int)GetCommsTotal:(NSString*)where;
+(NSArray*)GetLimitCommentaries:(NSString*)where Offset:(int)offset Limit:(int)limit;
+(int)RemoveCommentary:(NSString*)where;
+(int)UpdateCommentary:(NSString*)where Keys:(NSArray*)keys;

-(void)SetCommentaryWithProduct:(CProduct*)product;
-(void)SetCommentaryWithDic:(NSDictionary*)dic;
-(void)SetCommentaryWithArr:(NSArray*)com;
-(int)SaveCommentary;
-(NSData*)GetComWriterIcon:(NSString*)path;
-(void)DownComWriterIcon:(NSString*)url;
-(void)SaveComWriterIcon:(NSString*)path Data:(NSData*)data;

@end
